package com.zan.springcloud.service;

import com.zan.springcloud.entity.CommonResult;
import com.zan.springcloud.entity.Payment;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;

/**
 * @Author Zan
 * @Create 2023/12/12 20:41
 * @Description : @FeignClient 表示使用Feign, value表示注册到eureka的服务名称applicationName
 */
@Component // 这个注解没必要，可以不加
@FeignClient(value = "CLOUD-PAYMENT-SERVICE")
public interface PaymentFeignService {

    @GetMapping("/payment/get/{id}")
    public CommonResult<Payment> getPaymentById(@PathVariable("id") Long id);

    @GetMapping("/payment/feign/timeout")
    public String paymentFeignTimeOut();
}
